package de.slothsoft.commons.swing.validation;

import javax.swing.JComponent;

public interface IValidationListener {

	void validationChanged(ValidationEvent event);

	/*
	 * 
	 */

	public static class ValidationEvent {

		private JComponent source;
		private boolean newValue;
		private String errorMessage;

		public ValidationEvent(JComponent source, boolean newValue,
				String errorMessage) {
			this.source = source;
			this.newValue = newValue;
			this.errorMessage = errorMessage;
		}

		public JComponent getSource() {
			return source;
		}

		public boolean getNewValue() {
			return newValue;
		}

		public String getErrorMessage() {
			return errorMessage;
		}

	}
}
